/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package multithread;

import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.BlockingQueue;

/**
 *
 * @author NDA
 */
public class MultiThread {

    public static void main(String[] args) throws InterruptedException {
        BlockingQueue<String> kho = new ArrayBlockingQueue<String>(10);
        NguoiCungCap nguoiCungCap = new NguoiCungCap(kho);
        ChuKho chuKho = new ChuKho(kho);
        Thread threadNguoiCungCap = new Thread(nguoiCungCap,"Người cung cấp");
        Thread threadChuKho = new Thread(chuKho,"Chủ kho");
        threadNguoiCungCap.start();
        threadChuKho.start();
        threadNguoiCungCap.join();
        threadChuKho.join();
    }
}